package com.leetcode.程序员面试金典.easy;

/**
 * @author 覃国强
 * @date 2022-05-13 18:30
 */
public class 面试题_10_01_合并排序的数组 {

  static
  class Solution {
    public void merge(int[] A, int m, int[] B, int n) {
      int index = A.length - 1;
      --m;
      --n;
      while (m >= 0 && n >= 0) {
        A[index--] = A[m] > B[n] ? A[m--] : B[n--];
      }
      while (n >= 0) {
        A[index--] = B[n--];
      }
    }
  }


}
